package com.example.cloudmusic.utils

import com.example.cloudmusic.home.model.Music
import com.example.cm_player.model.SongInfo

/**
 * music和songInfo互相转换
 */
object ConversionTool{
    fun musicToSongInfo(music: Music) = SongInfo(
        music.id,
        music.title,
        music.artist,
        music.album,
        music.imageUrl,
        music.duration,
        music.playUrl,
        music.isVip,
        music.isFavorite,
        music.type
    )

    fun songInfoToMusic(songInfo: SongInfo) = Music(
        songInfo.id,
        songInfo.title,
        songInfo.artist,
        songInfo.album,
        songInfo.imageUrl,
        songInfo.duration,
        songInfo.playUrl,
        songInfo.isVip,
        songInfo.isFavorite,
        songInfo.type
    )
}